from selenium.webdriver.common.by import By


class Login():

    def __init__(self, driver):
        self.driver = driver

    def login(self, username, password):
        # 点击账号密码登录
        self.driver.find_element(By.CSS_SELECTOR, '#TANGRAM__PSP_4__sms_btn_back').click()
        # 输入账号
        self.driver.find_element(By.CSS_SELECTOR, '#TANGRAM__PSP_4__userName').send_keys(username)
        # 输入密码
        self.driver.find_element(By.CSS_SELECTOR, '#TANGRAM__PSP_4__password').send_keys(password)
        # 点击登录
        self.driver.find_element(By.CSS_SELECTOR, '#TANGRAM__PSP_4__submit').click()
